import { useRef } from 'react'

export default function UncontrolledForm() {
  const emailRef = useRef<HTMLInputElement>(null!)

  const handleSubmit = (e: any) => {
    e.preventDefault()
    alert(`Submitted Email:  ${emailRef.current.value}`)
  }

  return (
    <form onSubmit={handleSubmit}>
      <label>Email: </label>
      <input type='email' ref={emailRef} />
      <button type='submit'>Submit</button>
    </form>
  )
}
